package org.apache.beam.examples.Models;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

public class QualityRuleResultModel implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;
    private String id;
    private boolean result;
    private QualityRuleColData qualityRuleColData;

    public QualityRuleResultModel() {
    }

    public QualityRuleResultModel(String id, boolean result, QualityRuleColData qualityRuleColData) {
        this.id = id;
        this.result = result;
        this.qualityRuleColData = qualityRuleColData;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        QualityRuleResultModel that = (QualityRuleResultModel) o;
        return isResult() == that.isResult() && Objects.equals(getId(), that.getId()) && Objects.equals(getQualityRuleRowData(), that.getQualityRuleRowData());
    }

    @Override
    public int hashCode() {
        int result1 = Objects.hashCode(getId());
        result1 = 31 * result1 + Boolean.hashCode(isResult());
        result1 = 31 * result1 + Objects.hashCode(getQualityRuleRowData());
        return result1;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public boolean isResult() {
        return result;
    }

    public void setResult(boolean result) {
        this.result = result;
    }

    public QualityRuleColData getQualityRuleRowData() {
        return qualityRuleColData;
    }

    public void setQualityRuleRowData(QualityRuleColData qualityRuleColData) {
        this.qualityRuleColData = qualityRuleColData;
    }
}
